package net.huashitong.oversee.dao;

import com.sirdc.modules.core.dao.GenericQuery;
import com.sirdc.modules.core.dao.StringDao;
import com.sirdc.modules.utils.StringUtils;
import net.huashitong.oversee.entity.TackTaskLog;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class TackTaskLogDao extends StringDao<TackTaskLog> {

    public List<TackTaskLog> queryTackLogByTaskId(String taskId) {
        GenericQuery query = createQuery("t");
        if(StringUtils.isNotBlank(taskId)){
            query.append(" and t.taskId=:taskId").setParam("taskId", taskId);
        }
        query.append(" ORDER BY concat(t.createDate,t.createTime) desc");
        return query.listResult();
    }
}
